package com.xdhl.fu.flight.info.api.factory;

import com.xdhl.fu.flight.info.api.RemoteFlightInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 航班信息服务降级处理
 *
 * @author 朱力维
 * @time 2022/6/12 21:05
 */
@Component
public class RemoteFlightInfoFallbackFactory implements FallbackFactory<RemoteFlightInfoService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteFlightInfoFallbackFactory.class);

    @Override
    public RemoteFlightInfoService create(Throwable throwable) {
        log.error("航班信息服务调用失败:{}", throwable.getMessage());
        return null;
    }

}
